package com.ruoyi.wb.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.wb.domain.WbComplaint;
import com.ruoyi.wb.mapper.WbComplaintMapper;
import com.ruoyi.wb.service.IWbComplaintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 投诉建议Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-10
 */
@Service
public class WbComplaintServiceImpl implements IWbComplaintService 
{
    @Autowired
    private WbComplaintMapper wbComplaintMapper;

    /**
     * 查询投诉建议
     * 
     * @param id 投诉建议主键
     * @return 投诉建议
     */
    @Override
    public WbComplaint selectWbComplaintById(Long id)
    {
        return wbComplaintMapper.selectWbComplaintById(id);
    }

    /**
     * 查询投诉建议列表
     * 
     * @param wbComplaint 投诉建议
     * @return 投诉建议
     */
    @Override
    public List<WbComplaint> selectWbComplaintList(WbComplaint wbComplaint)
    {
        return wbComplaintMapper.selectWbComplaintList(wbComplaint);
    }

    /**
     * 新增投诉建议
     * 
     * @param wbComplaint 投诉建议
     * @return 结果
     */
    @Override
    public int insertWbComplaint(WbComplaint wbComplaint)
    {
        wbComplaint.setCreateTime(DateUtils.getNowDate());
        return wbComplaintMapper.insertWbComplaint(wbComplaint);
    }

    /**
     * 修改投诉建议
     * 
     * @param wbComplaint 投诉建议
     * @return 结果
     */
    @Override
    public int updateWbComplaint(WbComplaint wbComplaint)
    {
        wbComplaint.setUpdateTime(DateUtils.getNowDate());
        return wbComplaintMapper.updateWbComplaint(wbComplaint);
    }

    /**
     * 批量删除投诉建议
     * 
     * @param ids 需要删除的投诉建议主键
     * @return 结果
     */
    @Override
    public int deleteWbComplaintByIds(Long[] ids)
    {
        return wbComplaintMapper.deleteWbComplaintByIds(ids);
    }

    /**
     * 删除投诉建议信息
     * 
     * @param id 投诉建议主键
     * @return 结果
     */
    @Override
    public int deleteWbComplaintById(Long id)
    {
        return wbComplaintMapper.deleteWbComplaintById(id);
    }
}
